﻿using System;
using System.Linq.Expressions;
using Fabrication.Extensions;

namespace Fabrication
{
    public class PropertySelector<T, TParam>
    {
        public IBuilderOptions<T> BuilderOptions { get; private set; }
        public string PropertyName { get; private set; }

        public PropertySelector(IBuilderOptions<T> builderOptions, Expression<Func<T, TParam>> member)
        {
            PropertyName = member.GetPropertyNameIfNotReadOnly();
            BuilderOptions = builderOptions;
        }
    }
}